package com.cgc.venus.server.core.k8s.inter;

import com.cgc.venus.server.core.exception.VenusException;
import io.fabric8.kubernetes.api.model.ConfigMap;
import io.fabric8.kubernetes.api.model.ConfigMapList;

import java.util.List;
import java.util.Map;

/**
 * Created by xyr on 2017/9/19.
 * kubernetes 配置管理对象操作接口
 */
public interface K8sConfigMapService {


    /*
    * 获得全部空间的配置集
    * */
    List<Map<String,Object>> getConfigMap(String namespace) throws VenusException;

    ConfigMapList getConfigMaps(String namespace) throws VenusException;


    /*
    * 查询配置集
    * */
    ConfigMap queryConfigMap(String namespace, String configMapName) throws VenusException;


    /*
    * 创建配置集
    * */
    ConfigMap addConfigMap(String namespace, String configMapName) throws VenusException;

    /*
    * 判断配置集里面是否存在相同的配置文件
    * */
    boolean existConfigFile(String namespace, String configMapName, String fileName) throws VenusException;


    /*
    * 往配置集里面添加,修改配置文件
    * */
    ConfigMap addConfigFile(String namespace, String configMapName, String fileName, String fileContent) throws VenusException;

    /*
    * 删除配置集中的单个文件
    * */
    ConfigMap deleteConfigFile(String namespace, String configMapName, String fileName) throws VenusException;

    /*
    * 删除配置集中多个文件
    * */
    ConfigMap batchDeleteConfigFile(String namespace, String configMapName,Map<String,String> filesMap) throws VenusException;


    /*
    * 删除整个配置集
    * */
    boolean deleteConfigMap(String namespace, String configMapName) throws VenusException;


    /*
    * 在配置集中,获得指定配置文件的内容
    * */
    String getConfigFileContent(String namespace, String configMapName, String fileName);







 }
